<?php
    use mForge\Helpers\HtmlBinder;
    use mForge\Helpers\Url;
?>
<div class="container">
    <form action="" method="post">
        <fieldset>
            <?php HtmlBinder::hiddenFor($userModel, 'id'); ?>
            <div class="field text">
                <?php HtmlBinder::labelFor($userModel, 'username'); ?>
                <?php HtmlBinder::textBoxFor($userModel, 'username'); ?>
                <?php HtmlBinder::validationMessagesFor($userModel, 'username'); ?>
            </div>
            <div class="field email">
                <?php HtmlBinder::labelFor($userModel, 'email'); ?>
                <?php HtmlBinder::inputFor('email', $userModel, 'email'); ?>
                <?php HtmlBinder::validationMessagesFor($userModel, 'email'); ?>
            </div>
            <div class="field text password">
                <?php HtmlBinder::labelFor($userModel, 'password'); ?>
                <?php HtmlBinder::passwordFor($userModel, 'password'); ?>
                <?php HtmlBinder::validationMessagesFor($userModel, 'password'); ?>
            </div>
            <?php if ($userModel->isLockedOut): ?>
            <div class="field checkbox">
                <p><strong>This user is currently locked out.</strong></p>
                <input type="checkbox" name="clearLock" id="clear-lock" />
                <label for="clear-lock">Clear lock and enable user login</label>
            </div>
            <?php endif; ?>
            <div class="field checkbox">
                <?php HtmlBinder::checkBoxFor($userModel, 'isActive'); ?>
                <?php HtmlBinder::labelFor($userModel, 'isActive'); ?>
                <?php HtmlBinder::validationMessagesFor($userModel, 'isActive'); ?>
            </div>
        </fieldset>
        <div class="actions">
            <button type="submit">Save user</button>
            <a href="<?php Url::baseUrl() ?>/users">Cancel</a>
        </div>
    </form>
</div>